index.md (3014B)
1 +++ 2 title = "Network: internet protocols" 3 +++ 4 5 # Network: internet protocols 6 **Internet protocols** 7 IPv4 8 9 - uses 32-bit addresses, in dotted decimal notation (e.g. 0x80D00297 == 128.208.2.151) 10 - prefixes are written with lowest IP address in block and size of block 11 - a prefix 37.60.0.0/16 means that first 16 bits are used by network 12 - subnet mask — a string of 1s that has length of number after slash in the network portion of IP address (so 16 in /16), IP address AND subnet mask gives network prefix 13 - header: 14 15 ![screenshot.png](b7d058e98446748e74208485b13cd793.png) 16 17 - Classless InterDomain Routing (CIDR) — combining multiple small prefixes into a larger prefix (route aggregation), with each router having the corresponding prefix information (like /22 or /20) 18 - Network Address Translation (NAT) 19 - house/company has a single external IP address and ports 20 - devices have internal IP addresses 21 - a Network Address Translation Box decides how to route within the home network 22 23 ![screenshot.png](55be5c42fb10bf8e6dbb5bbd2648c51f.png) 24 25 IPv6 26 27 - many more addresses, simplified header (better bandwidth/latency), easier to add options, improved security support 28 - uses 128-bit addresses, in hex notation (e.g. 8000::123:3567:89AB:CDEF) 29 30 Internet Control Protocols 31 32 - Internet Control Message Protocol (ICMP) 33 - if there’s a fuckarino, routers send these messages to senders 34 - used e.g. when dest is unreachable, time exceeded (used by traceroute), echo/echo reply (used by ping), router advert/solicitation 35 - Address Resolution Protocol (ARP) 36 - A outputs broadcast packet asking who owns an IP address, to every machine on the network 37 - only the host with the IP address responds with Ethernet its address 38 - Dynamic Host Configuration Protocol (DHCP) 39 - every network has a DHCP server 40 - on startup, a computer has a built-in link layer address in NIC, but no IP address 41 - computer sends DHCP DISCOVER packet to server, which allocates a free IP address and sends back a DHCP OFFER packet 42 - leasing — IP address assignment is for a fixed period of time, host has to ask for renewal just before it expires or lose the address 43 - MultiProtocol Label Switching (MPLS) 44 - adds a label in front of each packet, forwarding is based on the label instead of dest address 45 - in between IP network protocol and PPP link protocol (it’s a “layer 2.5 protocol”) 46 - MPLS headers are not part of layer packet or data link frame, so it’s independent — it can forward both IP and non-IP packets (hence “multiprotocol”) 47 48 Interior Gateway Protocols 49 50 - example — Open Shortest Path First (OSPF) 51 - routing within a large independent network 52 - a form of link state routing, uses a hierarchy called ‘areas’ 53 54 Exterior Gateway Protocol 55 56 - example — Border Gateway Protocol (BGP) 57 - routing between large independent networks 58 - supports arbitrary policies from ISPs/companies/countries 59 - a form of distance vector routing combined with a path vector protocol